set(File_LIB file_intf)

find_package(PkgConfig REQUIRED)
find_package(skynet REQUIRED)
find_package(liblogger REQUIRED)
find_package(huawei_secure_c REQUIRED)
find_package(libmc4lua REQUIRED)
pkg_search_module(GLIB REQUIRED glib-2.0)
pkg_search_module(GMODULE REQUIRED gmodule-2.0)

file(GLOB_RECURSE SOURCES "*.c")
add_library(${File_LIB} SHARED ${SOURCES})
target_include_directories(${File_LIB}
    PUBLIC ${LUACLIB_SRC_DIR}
    PUBLIC ${CONAN_INCLUDE_DIRS}
    PUBLIC ${GLIB_INCLUDE_DIRS}
)

target_link_libraries(${File_LIB}
    PUBLIC ${CONAN_LIBS_HUAWEI_SECURE_C}
    PUBLIC ${GLIB_LIBRARIES}
    PUBLIC ${CONAN_LIBS_LIBMC4LUA}
    PUBLIC logging
    PUBLIC skynet::skynet
    PUBLIC liblogger::liblogger
    PUBLIC libmc4lua::libmc4lua
    PUBLIC huawei_secure_c::huawei_secure_c
)

set_target_properties(${File_LIB} PROPERTIES PREFIX "")
install(TARGETS ${File_LIB} DESTINATION ${LUACLIB_INSTALL_DIR})
install(TARGETS ${File_LIB} DESTINATION opt/bmc/luaclib)
